function hrefaddblog() {
  jQuery.ajax({
    url: "/user/checkSession", // 根据你的后端路由配置
    type: "GET",
    success: function (res) {
      if (res.code == 200) {
        location.href = "blog_add.html";
      } else {
        if (confirm("请先登录！")) {
          location.href = "login.html";
        }
      }
    }
  });
}